wayland: return child only in device_query_state()
authorOlivier Fourdan <ofourdan@redhat.com>
Wed, 29 Jun 2016 13:08:06 +0000 (15:08 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Mon, 4 Jul 2016 07:46:18 +0000 (09:46 +0200)
commit298221bfba9b784cddaf5d6ac121e9bb3f25c0db
treec1f5572cd973d19872d76fd3ad18b175857ed821
parent4c01ab8945a8e6a07dbc93b157bc6aa1808e7819
wayland: return child only in device_query_state()

On X11, device_query_state() uses XIQueryPointer() which will return a
child window only if the pointer is within an actual child of the given
window.

Wayland backend would return the pointer->focus window independently of
the given window, but that breaks the logic in get_device_state() and
later in gdk_window_get_device_position_double() because the window is
searched based on coordinates from another window without sibling
relationship, breaking gtkmenu sub-menus further down the line.

Fix the Wayland backend to mimic X11's XIQueryPointer() to return a
child only if really a child of the given window.

That's the most sensible thing to do to fix the issue, but the API here
seems to be modeled after the X11 implementation and the description of
gdk_window_get_device_position_double() is not entirely accurate.

https://bugzilla.gnome.org/show_bug.cgi?id=768016
gdk/wayland/gdkdevice-wayland.c